public class Numbers
{
   /**
      Counts the number of 7s in a given number
      @param num a number >= 0
      @return the number of digits in num that are 7
   */
   public static int countSevens(int num)
   {
      
      int sum = 0;
      String str = num + "";
      char[] array = str.toCharArray();
      for(char c:array)
      {
         if(c == '7')
         sum++;
      }
      return sum;
   }
}